<template>
  <div>
    <h1 @click="visibale=!visibale">父组件</h1>
    <div>
      {{ count }}
      <button @click="count++">+</button>
    </div>
    <Child :pcount="count" v-if="visibale"></Child>
  </div>
</template>

<script lang='ts' setup>
import {onBeforeMount,onMounted,onBeforeUpdate,onUpdated,onBeforeUnmount,onUnmounted} from 'vue'
import Child from '@/views/Child.vue'
import {ref} from 'vue'
const count=ref<number>(0)
const visibale=ref<boolean>(true)
onBeforeMount(()=>{
  console.log('=====parent的onBeforeMount======');
})
onMounted(()=>{
  console.log('=====parent的onMounted======');
})
onBeforeUpdate(()=>{
  console.log('=====parent的onBeforeUpdate======');
})
onUpdated(()=>{
  console.log('=====parent的onUpdated======');
})
onBeforeUnmount(()=>{
  console.log('=====parent的onBeforeUnmount======');
})
onUnmounted(()=>{
  console.log('=====parent的onUnmounted======');
})

</script>

<style lang='scss' scoped>
</style>